/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.repair.service;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.repair.dto.sign.SignDetailSearchDTO;
import org.springblade.modules.repair.entity.MaintainSignCalendar;
import org.springblade.modules.repair.entity.UserSignDetail;
import org.springblade.modules.repair.vo.HomeUserSignCountVO;
import org.springblade.modules.repair.vo.UserSignDetailVO;
import org.springblade.modules.repair.vo.plan.SignRangeVo;
import org.springblade.modules.repair.vo.sign.*;

import java.util.List;

/**
 * 用户签到明细表 服务类
 *
 * @author zcc
 * @since 2021-07-28
 */
public interface IUserSignDetailService extends BaseService<UserSignDetail> {

	/**
	 * 自定义分页
	 *
	 * @param page 分页
	 * @param userSignDetail 查询条件
	 * @return 数据集
	 */
	IPage<UserSignDetailVO> selectUserSignDetailPage(IPage<UserSignDetailVO> page, UserSignDetailVO userSignDetail);


	/**
	 * 根据用户id获取考勤经纬度
	 * @param userId 用户id
	 * @return 数据集
	 */
	List<SignRangeVo> getSignRangeVoList(Long userId);


	/**
	 * 获取月份的考勤数据
	 * @param userId 用户id
	 * @param beginDate 开始时间
	 * @param endDate 结束时间
	 * @return 数据集
	 */
	List<UserSignDetail> list(Long userId, Integer beginDate,Integer endDate);

	/**
	 * 获取当天的考勤数据
	 * @param userId
	 * @param today
	 * @return
	 */
	MaintainSignCalendar getOne(Long userId, Integer today);


	/**
	 * 获取用户考勤统计信息
	 * @param signDetailSearchDTO 查询条件
	 * @return 数据集
	 */
    UserSignDetailVo getUserSignDetail(SignDetailSearchDTO signDetailSearchDTO);

	/**
	 * 获取维保组长和维保经理的下级的加班信息
	 * @param signDetailSearchDTO 查询条件
	 * @return 数据集
	 */
	RestUserSignDetailVo getRestUserSignDetail(SignDetailSearchDTO signDetailSearchDTO);


	/**
	 * 工作日获取人员的统计信息
	 * @param signDetailSearchDTO 查询条件
	 * @return 数据集
	 */
	WorkUserSignDetailVo getWorkUserSignDetail(SignDetailSearchDTO signDetailSearchDTO);

	/**
	 *
	 * @param signDetailSearchDTO
	 * @return
	 */
	DateUserSignDetailVo getDateUserSignDetail(SignDetailSearchDTO signDetailSearchDTO);


	/**
	 * 获取考勤的在职工作人员
	 * @param userIds
	 * @return
	 */
	List<SignWorkUserVo> getWorkUserList(List<Long> userIds);


	HomeUserSignCountVO selectUserSign(Long userId);

    JSONObject getHolidays(Integer year);
}
